#!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Laypage:
    def __init__(self,list,limit):
        self.list = list
        self.limit = limit
        self.next = 0
        self.size = int(len(list) / limit)
        if(len(list) % limit!=0):
            self.size = self.size+1
    def lastList(self):
        if(self.next<=0):
            return []
        self.next = self.next-1
        list = self.list[self.next*self.limit:self.next*self.limit+self.limit]
        return list

    def nextList(self):
        if(self.next==self.size):
            return []
        list = self.list[self.next*self.limit:self.next*self.limit+self.limit]
        self.next = self.next+1
        return list

